<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .content{
            position:fixed;
            width: 200px;
            height: 200px;
            bottom: 0;
            left: 0;
            background: gray;
        }
        .close{
            float:right;
        }
    </style>
</head>
<body>
    <div class="content">
        <div class="close">X</div>
    </div>
    <script>
        var closeEle = document.querySelector(".close");
        var contentEle = document.querySelector(".content");
        // 判断 广告是否显示 ；true证明广告显示了  false 证明广告没显示
        var isShow = true;
        // 点击关闭按钮 隐藏广告
        closeEle.onclick = function(){
            contentEle.style.display = "none";
            isShow = false;
        }
        setInterval(() => {
            if(!isShow){
                contentEle.style.display = "block";
            }
        }, 5000);



    </script>
</body>
</html>